home *** CD-ROM | disk | FTP | other *** search
Wrap
SHMEM_BROADCAST(3) SHMEM_BROADCAST(3) NNNNAAAAMMMMEEEE sssshhhhmmmmeeeemmmm____bbbbrrrrooooaaaaddddccccaaaasssstttt4444, sssshhhhmmmmeeeemmmm____bbbbrrrrooooaaaaddddccccaaaasssstttt8888, sssshhhhmmmmeeeemmmm____bbbbrrrrooooaaaaddddccccaaaasssstttt33332222, sssshhhhmmmmeeeemmmm____bbbbrrrrooooaaaaddddccccaaaasssstttt66664444 - Broadcasts a block of data from one processing element (PE) to one or more target PEs SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS C or C++: ####iiiinnnncccclllluuuuddddeeee <<<<mmmmpppppppp////sssshhhhmmmmeeeemmmm....hhhh>>>> vvvvooooiiiidddd sssshhhhmmmmeeeemmmm____bbbbrrrrooooaaaaddddccccaaaasssstttt33332222((((vvvvooooiiiidddd ****_t_a_r_g_e_t,,,, ccccoooonnnnsssstttt vvvvooooiiiidddd ****_s_o_u_r_c_e,,,, ssssiiiizzzzeeee____tttt _n_l_o_n_g,,,, iiiinnnntttt _P_E__r_o_o_t,,,, iiiinnnntttt _P_E__s_t_a_r_t,,,, iiiinnnntttt _l_o_g_P_E__s_t_r_i_d_e,,,, iiiinnnntttt _P_E__s_i_z_e,,,, lllloooonnnngggg ****_p_S_y_n_c))));;;; vvvvooooiiiidddd sssshhhhmmmmeeeemmmm____bbbbrrrrooooaaaaddddccccaaaasssstttt66664444((((vvvvooooiiiidddd ****_t_a_r_g_e_t,,,, ccccoooonnnnsssstttt vvvvooooiiiidddd ****_s_o_u_r_c_e,,,, ssssiiiizzzzeeee____tttt _n_l_o_n_g,,,, iiiinnnntttt _P_E__r_o_o_t,,,, iiiinnnntttt _P_E__s_t_a_r_t,,,, iiiinnnntttt _l_o_g_P_E__s_t_r_i_d_e,,,, iiiinnnntttt _P_E__s_i_z_e,,,, lllloooonnnngggg ****_p_S_y_n_c))));;;; Fortran: IIIINNNNCCCCLLLLUUUUDDDDEEEE """"mmmmpppppppp////sssshhhhmmmmeeeemmmm....ffffhhhh"""" IIIINNNNTTTTEEEEGGGGEEEERRRR _n_l_o_n_g,,,, _P_E__r_o_o_t,,,, _P_E__s_t_a_r_t,,,, _l_o_g_P_E__s_t_r_i_d_e,,,, _P_E__s_i_z_e IIIINNNNTTTTEEEEGGGGEEEERRRR _p_S_y_n_c((((SSSSHHHHMMMMEEEEMMMM____BBBBCCCCAAAASSSSTTTT____SSSSYYYYNNNNCCCC____SSSSIIIIZZZZEEEE)))) CCCCAAAALLLLLLLL SSSSHHHHMMMMEEEEMMMM____BBBBRRRROOOOAAAADDDDCCCCAAAASSSSTTTT4444((((_t_a_r_g_e_t,,,, _s_o_u_r_c_e,,,, _n_l_o_n_g,,,, _P_E__r_o_o_t,,,, _P_E__s_t_a_r_t,,,, _l_o_g_P_E__s_t_r_i_d_e,,,, _P_E__s_i_z_e,,,, ffffIIIIppppSSSSyyyynnnncccc)))) CCCCAAAALLLLLLLL SSSSHHHHMMMMEEEEMMMM____BBBBRRRROOOOAAAADDDDCCCCAAAASSSSTTTT8888((((_t_a_r_g_e_t,,,, _s_o_u_r_c_e,,,, _n_l_o_n_g,,,, _P_E__r_o_o_t,,,, _P_E__s_t_a_r_t,,,, _l_o_g_P_E__s_t_r_i_d_e,,,, _P_E__s_i_z_e,,,, _p_S_y_n_c)))) CCCCAAAALLLLLLLL SSSSHHHHMMMMEEEEMMMM____BBBBRRRROOOOAAAADDDDCCCCAAAASSSSTTTT33332222((((_t_a_r_g_e_t,,,, _s_o_u_r_c_e,,,, _n_l_o_n_g,,,, _P_E__r_o_o_t,,,, _P_E__s_t_a_r_t,,,, _l_o_g_P_E__s_t_r_i_d_e,,,, _P_E__s_i_z_e,,,, _p_S_y_n_c)))) CCCCAAAALLLLLLLL SSSSHHHHMMMMEEEEMMMM____BBBBRRRROOOOAAAADDDDCCCCAAAASSSSTTTT66664444((((_t_a_r_g_e_t,,,, _s_o_u_r_c_e,,,, _n_l_o_n_g,,,, _P_E__r_o_o_t,,,, _P_E__s_t_a_r_t,,,, _l_o_g_P_E__s_t_r_i_d_e,,,, _P_E__s_i_z_e,,,, _p_S_y_n_c)))) DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN The shared memory (SHMEM) broadcast routines are collective routines. They copy data object _s_o_u_r_c_e on the processor specified by _P_E__r_o_o_t and store the values at _t_a_r_g_e_t on the other PEs specified by the triplet _P_E__s_t_a_r_t, _l_o_g_P_E__s_t_r_i_d_e, _P_E__s_i_z_e. The data is not copied to the target area on the root PE. As with all SHMEM collective routines, each of these routines assumes that only PEs in the active set call the routine. If a PE not in the active set calls a SHMEM collective routine, undefined behavior results. The arguments are as follows: _t_a_r_g_e_t A symmetric data object with one of the following data types: RRRRoooouuuuttttiiiinnnneeee DDDDaaaattttaaaa TTTTyyyyppppeeee aaaannnndddd LLLLaaaannnngggguuuuaaaaggggeeee sssshhhhmmmmeeeemmmm____bbbbrrrrooooaaaaddddccccaaaasssstttt8888, sssshhhhmmmmeeeemmmm____bbbbrrrrooooaaaaddddccccaaaasssstttt66664444 Any noncharacter type that has an element size of 64 bits. No Fortran derived types or C/C++ structures are allowed. sssshhhhmmmmeeeemmmm____bbbbrrrrooooaaaaddddccccaaaasssstttt33332222 Any noncharacter type that has an element size of 32 bits. No Fortran derived types or C/C++ structures are allowed. sssshhhhmmmmeeeemmmm____bbbbrrrrooooaaaaddddccccaaaasssstttt4444 Any noncharacter type that has an element size of 32 bits. _s_o_u_r_c_e A symmetric data object that can be of any data type that is permissible for the _t_a_r_g_e_t argument. _n_l_o_n_g The number of elements in _s_o_u_r_c_e. For sssshhhhmmmmeeeemmmm____bbbbrrrrooooaaaaddddccccaaaasssstttt33332222 and sssshhhhmmmmeeeemmmm____bbbbrrrrooooaaaaddddccccaaaasssstttt4444, this is the number of 32-bit halfwords. _n_l_o_n_g must be of type integer. If you are using Fortran, it must be a default integer value. _P_E__r_o_o_t Zero-based ordinal of the PE, with respect to the active set, from which the data is copied. Must be greater than or equal to 0 and less than PPPPEEEE____ssssiiiizzzzeeee. _P_E__r_o_o_t must be of type integer. If you are using Fortran, it must be a default integer value. _P_E__s_t_a_r_t The lowest virtual PE number of the active set of PEs. _P_E__s_t_a_r_t must be of type integer. If you are using Fortran, it must be a default integer value. _l_o_g_P_E__s_t_r_i_d_e The log (base 2) of the stride between consecutive virtual PE numbers in the active set. _l_o_g__P_E__s_t_r_i_d_e must be of type integer. If you are using Fortran, it must be a default integer value. _P_E__s_i_z_e The number of PEs in the active set. _P_E__s_i_z_e must be of type integer. If you are using Fortran, it must be a default integer value. _p_S_y_n_c A symmetric work array. In C/C++, _p_S_y_n_c must be of type lllloooonnnngggg and size ____SSSSHHHHMMMMEEEEMMMM____BBBBCCCCAAAASSSSTTTT____SSSSYYYYNNNNCCCC____SSSSIIIIZZZZEEEE. In Fortran, _p_S_y_n_c must be of type integer and size SSSSHHHHMMMMEEEEMMMM____BBBBCCCCAAAASSSSTTTT____SSSSYYYYNNNNCCCC____SSSSIIIIZZZZEEEE. Every element of this array must be initialized with the value ____SSSSHHHHMMMMEEEEMMMM____SSSSYYYYNNNNCCCC____VVVVAAAALLLLUUUUEEEE (in C/C++) or SSSSHHHHMMMMEEEEMMMM____SSSSYYYYNNNNCCCC____VVVVAAAALLLLUUUUEEEE (in Fortran) before any of the PEs in the active set enter sssshhhhmmmmeeeemmmm____bbbbaaaarrrrrrrriiiieeeerrrr(). The values of arguments _P_E__r_o_o_t, _P_E__s_t_a_r_t, _l_o_g_P_E__s_t_r_i_d_e, and _P_E__s_i_z_e must be equal on all PEs in the active set. The same _t_a_r_g_e_t and _s_o_u_r_c_e data objects and the same _p_S_y_n_c work array must be passed to all PEs in the active set. Before any PE calls a broadcast routine, you must ensure that the following conditions exist (synchronization via a barrier or some other method is often needed to ensure this): * The _p_S_y_n_c array on all PEs in the active set is not still in use from a prior call to a broadcast routine. * The _t_a_r_g_e_t array on all PEs in the active set is ready to accept the broadcast data. Upon return from a broadcast routine, the following are true for the local PE: * If the current PE is not the root PE, the _t_a_r_g_e_t data object is updated. * The data cache region that is mapped to the _t_a_r_g_e_t data object is coherent. * The values in the _p_S_y_n_c array are restored to the original values. NNNNOOOOTTTTEEEESSSS The terms _c_o_l_l_e_c_t_i_v_e and _s_y_m_m_e_t_r_i_c are defined in iiiinnnnttttrrrroooo____sssshhhhmmmmeeeemmmm(3). All SHMEM broadcast routines restore _p_S_y_n_c to its original contents. Multiple calls to SHMEM routines that use the same _p_S_y_n_c array do not require that _p_S_y_n_c be reinitialized after the first call. You must ensure the that the _p_S_y_n_c array is not being updated by any PE in the active set while any of the PEs participates in processing of a SHMEM broadcast routine. Be careful to avoid these situations: * If the _p_S_y_n_c array is initialized at run time, some type of synchronization is needed to ensure that all PEs in the working set have initialized _p_S_y_n_c before any of them enter a SHMEM routine called with the _p_S_y_n_c synchronization array. * A _p_S_y_n_c array may be reused on a subsequent SHMEM broadcast routine only if none of the PEs in the active set are still processing a prior SHMEM broadcast routine call that used the same _p_S_y_n_c array. In general, this can be ensured only by doing some type of synchronization. However, in the special case of SHMEM routines being called with the same active set, you can allocate two _p_S_y_n_c arrays and alternate between them on successive calls. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS In the following examples, the call to sssshhhhmmmmeeeemmmm____bbbbrrrrooooaaaaddddccccaaaasssstttt66664444 copies _s_o_u_r_c_e on PE 4 to _t_a_r_g_e_t on PEs 5, 6, and 7. C/C++ example: for (i=0; i < _SHMEM_BCAST_SYNC_SIZE; i++) { pSync[i] = _SHMEM_SYNC_VALUE; } shmem_barrier_all(); /* Wait for all PEs to initialize pSync */ shmem_broadcast64(target, source, nlong, 0, 4, 0, 4, pSync); Fortran example: INTEGER PSYNC(SHMEM_BCAST_SYNC_SIZE) INTEGER TARGET, SOURCE, NLONG, PE_ROOT, PE_START, & LOGPE_STRIDE, PE_SIZE, PSYNC COMMON /COM/ TARGET, SOURCE DATA PSYNC /SHMEM_BCAST_SYNC_SIZE*SHMEM_SYNC_VALUE/ CALL SHMEM_BROADCAST64(TARGET, SOURCE, NLONG, 0, 4, 0, 4, PSYNC) SSSSEEEEEEEE AAAALLLLSSSSOOOO iiiinnnnttttrrrroooo____bbbbllllaaaaccccssss(3S), iiiinnnnttttrrrroooo____sssshhhhmmmmeeeemmmm(3) _M_e_s_s_a_g_e _P_a_s_s_i_n_g _T_o_o_l_k_i_t: _M_P_I _P_r_o_g_r_a_m_m_e_r'_s _M_a_n_u_a_l